package com.cws4cloud.cws.common.core.tenant;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 多租户配置
 *
 * @author zhlj
 */
@Getter
@Setter
@ConfigurationProperties(prefix = "cws.tenant")
public class CwsTenantProperties {

	/**
	 * 多租户字段名称
	 */
	private String column = "tenant_id";

	/**
	 * 排除多租户数据表
	 */
	private List<String> ignoreTables = new ArrayList<>();

	/**
	 * 是否开启多租户模式
	 */
	private boolean enable = false;

	/**
	 * 排除不进行租户隔离的sql
	 * 样例全路径：vip.mate.system.mapper.UserMapper.findList
	 */
	private List<String> ignoreSqls = new ArrayList<>();

	/**
	 * 多租户系统数据表
	 */
	private List<String> cwsTables = Arrays.asList("sys_log","sys_dept_relation","sys_user_role","sys_tenant");
}
